<h1>
  {{#if value}}
    Search results for <em>{{value}}</em>
  {{else}}
    Invalid search
  {{/if}}
</h1>

{{#isNonEmptyArray results}}
  {{#each results}}
    <div class="result">
      <h2 class="result-id">
        <a href="{{this.ref}}">
          <span translate="no">{{this.title}}</span> <small>({{this.type}})</small>
        </a>
      </h2>
        {{#each excerpts}}
          <p class="result-elem">{{{this}}}</p>
        {{/each}}
    </div>
  {{/each}}
{{else}}
  {{#isArray results}}
    <p>Sorry, we couldn't find anything for <em>{{value}}</em>.</p>
  {{else if value}}
    <p>Invalid search: {{errorMessage}}.</p>
  {{else}}
    <p>Please type something into the search bar to perform a search.</p>
  {{/isArray}}

  <p>The search functionality is full-text based. Here are some tips:</p>

  <ul>
    <li>Multiple words (such as <code>foo bar</code>) are searched as <code>OR</code></li>
    <li>Use <code>*</code> anywhere (such as <code>fo*</code>) as wildcard</li>
    <li>Use <code>+</code> before a word (such as <code>+foo</code>) to make its presence required</li>
    <li>Use <code>-</code> before a word (such as <code>-foo</code>) to make its absence required</li>
    <li>Use <code>:</code> to search on a particular field (such as <code>field:word</code>). The available fields are <code>title</code>, <code>doc</code> and <code>type</code></li>
    <li>Use <code>WORD^NUMBER</code> (such as <code>foo^2</code>) to boost the given word</li>
    <li>Use <code>WORD~NUMBER</code> (such as <code>foo~2</code>) to do a search with edit distance on word</li>
  </ul>

  <p>To quickly go to a module, type, or function, use the autocompletion feature in the sidebar search.</p>
{{/isNonEmptyArray}}
